﻿/*
' DotNetNuke® - http://www.dotnetnuke.com
' Copyright (c) 2002-2006
' by Perpetual Motion Interactive Systems Inc. ( http://www.perpetualmotion.ca )
'
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all copies or substantial portions 
' of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
' DEALINGS IN THE SOFTWARE.
 */

using System;
using DotNetNuke;
using System.Data;

using DotNetNuke.Framework;

namespace Triax.Modules.Department
{
    /// -----------------------------------------------------------------------------
    /// <summary>
    /// An abstract class that provides the DAL contract
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public abstract class DataProvider
    {

    #region Shared/Static Methods

        // singleton reference to the instantiated object 
        static DataProvider  objProvider = null;

        // constructor
        static DataProvider()
        {
            CreateProvider();
        }

        // dynamically create provider
        private static void CreateProvider()
        {
            objProvider = (DataProvider)Reflection.CreateObject("data", "Triax.Modules.Department", "");
        }

        // return the provider
        public static  DataProvider Instance() 
        {
            return objProvider;
        }

    #endregion

    #region Abstract methods

        // Department
        public abstract void AddDepartment(int ModuleId, string DepartmentName, string Description, int ParentId, int DepartmentType, int Status, int UserId,  int DepartmentUserId);
        public abstract IDataReader GetDepartment(int ModuleId, int DepartmentId);
        public abstract IDataReader GetDepartments(int ModuleId);
        public abstract void UpdateDepartment(int ModuleId, int DepartmentId, string DepartmentName, string Description, int ParentId, int DepartmentType, int Status, int UserId,  int DepartmentUserId);
        public abstract void DeleteDepartment(int ModuleId, int DepartmentId);
        public abstract IDataReader GetDepartmentsByCond(int ModuleId, string Cond, string Sql);

        // Customet
        
        public abstract void AddCustomer(
            int ModuleId,
            int PlanInfoID,
string TenKhachHang,
string DiaChi,
string SoDienThoai,
string Fax,
string MST,
string STK,
int NguoiPhuTrach,
string Thongtinkhac,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
int IsDelete,
int TempInt1,
int TempInt2,
int TempInt3,
int TempInt4,
string TempStr1,
string TempStr2,
string TempStr3,
string TempStr4,
DateTime TempDate1,
DateTime TempDate2

            );
        public abstract IDataReader GetCustomer(int ModuleId, int CustomerId);
        public abstract IDataReader GetCustomers(int ModuleId);
        public abstract void UpdateCustomer(int ModuleId,

            int CustomerId,
             int PlanInfoID,
string TenKhachHang,
string DiaChi,
string SoDienThoai,
string Fax,
string MST,
string STK,
int NguoiPhuTrach,
string Thongtinkhac,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
int IsDelete,
int TempInt1,
int TempInt2,
int TempInt3,
int TempInt4,
string TempStr1,
string TempStr2,
string TempStr3,
string TempStr4,
DateTime TempDate1,
DateTime TempDate2
            );
        public abstract void DeleteCustomer(int ModuleId, int CustomerId);
        public abstract IDataReader GetCustomersByCond(int ModuleId, string Cond, string Sql);
      
        // PlanInfo
        public abstract void AddPlanInfo(
            int ModuleId,
           int CustumerID,
string Name,
string KhoSach,
string Conten,
int SoTrang,
int SoLuong,
int UserId ,
DateTime CreateDate,
DateTime CheckDate,
int IsSend,
int Ischeck,
int IsOk,
DateTime NgayChuyen,
int IsDelete,
int tempInt1,
int tempInt2,
int tempInt3,
int tempInt4,
string tempStr1,
string tempStr2,
string tempStr3,
string tempStr4,
DateTime tempDate1,
DateTime tempDate2


            );
        public abstract IDataReader GetPlanInfo(int ModuleId, int PlanInfoId);
        public abstract IDataReader GetPlanInfos(int ModuleId);
        public abstract void UpdatePlanInfo(int ModuleId,
            int ID,
int CustumerID,
string Name,
string KhoSach,
string Conten,
int SoTrang,
int SoLuong,
int UserId ,
DateTime CreateDate,
DateTime CheckDate,
int IsSend,
int Ischeck,
int IsOk,
DateTime NgayChuyen,
int IsDelete,
int tempInt1,
int tempInt2,
int tempInt3,
int tempInt4,
string tempStr1,
string tempStr2,
string tempStr3,
string tempStr4,
DateTime tempDate1,
DateTime tempDate2


            );
        public abstract void DeletePlanInfo(int ModuleId, int PlanInfoId);
        public abstract IDataReader GetPlanInfosByCond(int ModuleId, string Cond, string Sql);

        // printshop

        public abstract void AddPrintshop(
            int ModuleId,

string TenNhaIn,
string Diachi,
string SoDienThoai,
string Fax,
string MST,
string STK,
string NguoiPhuTrach,
string Other,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
int IsDelete,
int tempInt1,
int tempInt2,
int tempInt3,
int tempInt4,
string tempStr1,
string tempStr2,
string tempStr3,
string tempStr4,
DateTime tempDate1,
DateTime tempDate2
            );
        public abstract IDataReader GetPrintshop(int ModuleId, int PrintshopId);
        public abstract IDataReader GetPrintshops(int ModuleId);
        public abstract void UpdatePrintshop(int ModuleId,
           int PrintshopId,
string TenNhaIn,
string Diachi,
string SoDienThoai,
string Fax,
string MST,
string STK,
string NguoiPhuTrach,
string Other,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
int IsDelete,
int tempInt1,
int tempInt2,
int tempInt3,
int tempInt4,
string tempStr1,
string tempStr2,
string tempStr3,
string tempStr4,
DateTime tempDate1,
DateTime tempDate2
            );
        public abstract void DeletePrintshop(int ModuleId, int PrintshopId);
        public abstract IDataReader GetPrintshopsByCond(int ModuleId, string Cond, string Sql);

        // contactTemplate

        public abstract void AddContractTemplate(
            int ModuleId,

string TieuDe,
string NoiDung,
int Nguoitao,
int KtCheck1,
int Khcheck1,
int Type,
int BienTap1,
int ThamDinh1,
int IsXuatBan,
int IsGiayPhep,
int IsPrint,
int CheckConten,
int PrintTo,
int checkSanpham,
int IsLuuChieu,
int IsPhatHanh,
int IsThanhLyDoiTac,
int IsThanhLyKhachHang,
DateTime Ngaythuchien,
DateTime hancuoi,
DateTime ngayKetThuc,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
string FileHopDong,
string FileThanhLy,
string FileKhac,
int IsDelete,
int tempInt1,
int tempInt2,
int tempInt3,
int tempInt4,
int tempInt5,
int tempInt6,
string tempStr1,
string tempStr2,
string tempStr3,
string tempStr4,
string tempStr5,
string tempStr6,
DateTime tempDate1,
DateTime tempDate2,
DateTime tempDate3,
DateTime tempDate4,
int BT_thamdinhbanthao,
int BT_thongnhatnoidungkhachhang,
int BT_trinhquxb,
int BT_kiemtratruockhiin,
int CheBan_cheban,
int CheBan_docbong,
int CheBan_inbong,
int CongNghe_giamsatnhain,
int CongNghe_kiemtrasanpham,
int KinhDoanh_nhansanpham,
int GiamDoc_LuuChieu,
int GiamDoc_quyetdinhxuatban,
int GiamDocChuyenPhatHanh,
int GiamdocKhac,
int CheBan_khac,
int BT_khac,
int Congnghe_khac,
string tempStr7,
string tempStr8,
string tempStr9,
string tempStr10,
string tempStr11,
string tempStr12,
string tempStr13,
string tempStr14,
string tempStr15,
string tempStr16,
string tempStr17,
string tempStr18,
string tempStr19,
string tempStr20,
string tempStr21,
string tempStr22,
string tempStr23,
string tempStr24,
string tempStr25,
string tempStr26,
string tempStr27,
string tempStr28,
string tempStr29,
string tempStr30



            );
        public abstract IDataReader GetContractTemplate(int ModuleId, int ContractTemplateId);
        public abstract IDataReader GetContractTemplates(int ModuleId);
        public abstract void UpdateContractTemplate(int ModuleId,
          int ContractTemplateId,
string TieuDe,
string NoiDung,
int Nguoitao,
int KtCheck1,
int Khcheck1,
int Type,
int BienTap1,
int ThamDinh1,
int IsXuatBan,
int IsGiayPhep,
int IsPrint,
int CheckConten,
int PrintTo,
int checkSanpham,
int IsLuuChieu,
int IsPhatHanh,
int IsThanhLyDoiTac,
int IsThanhLyKhachHang,
DateTime Ngaythuchien,
DateTime hancuoi,
DateTime ngayKetThuc,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
string FileHopDong,
string FileThanhLy,
string FileKhac,
int IsDelete,
int tempInt1,
int tempInt2,
int tempInt3,
int tempInt4,
int tempInt5,
int tempInt6,
string tempStr1,
string tempStr2,
string tempStr3,
string tempStr4,
string tempStr5,
string tempStr6,
DateTime tempDate1,
DateTime tempDate2,
DateTime tempDate3,
DateTime tempDate4,
int BT_thamdinhbanthao,
int BT_thongnhatnoidungkhachhang,
int BT_trinhquxb,
int BT_kiemtratruockhiin,
int CheBan_cheban,
int CheBan_docbong,
int CheBan_inbong,
int CongNghe_giamsatnhain,
int CongNghe_kiemtrasanpham,
int KinhDoanh_nhansanpham,
int GiamDoc_LuuChieu,
int GiamDoc_quyetdinhxuatban,
int GiamDocChuyenPhatHanh,
int GiamdocKhac,
int CheBan_khac,
int BT_khac,
int Congnghe_khac,
string tempStr7,
string tempStr8,
string tempStr9,
string tempStr10,
string tempStr11,
string tempStr12,
string tempStr13,
string tempStr14,
string tempStr15,
string tempStr16,
string tempStr17,
string tempStr18,
string tempStr19,
string tempStr20,
string tempStr21,
string tempStr22,
string tempStr23,
string tempStr24,
string tempStr25,
string tempStr26,
string tempStr27,
string tempStr28,
string tempStr29,
string tempStr30



            );
        public abstract void DeleteContractTemplate(int ModuleId, int ContractTemplateId);
        public abstract IDataReader GetContractTemplatesByCond(int ModuleId, string Cond, string Sql);
        public abstract IDataReader GetContractTemplatesByCondIn(int ModuleId, string Cond, string Sql);

        // Publication
        public abstract void AddPublication(
          int ModuleId,

int ContractTemplateID,
string TenAnPham,
string TacGia,
string DichGia,
int SoTrang,
string KhoGiay,
string Bia,
int SoLuongIn,
string QuyCach,
string NoiDung,
string SoDangKy,
int DonGia,
long TongTien,
string MaSoISBN,
string Noidungkhac,
int IsXuatBan,
int IsPrint,
string SoQuyetDinhXB,
DateTime NgayQDXB,
string NguoiKy,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
int IsDelete,
int IsLuuChieu,
string SoXuatBan,
int TempInt1,
int TempInt2,
int TempInt3,
int TempInt4,
string TempStr1,
string TempStr2,
string TempStr3,
string TempStr4,
DateTime TempDate1,
DateTime TempDate2,
                                int SoluongDatin,
int SoLuongPhatHanh,
string Filebientap,
string FIleString1,
string FIleString2,
string FIleString3,
string FIleString4,
string FIleString5,
string FIleString6,
string FIleString7,
string FIleString8,
string FIleString9,
string FIleString10,
int CheckGiamDoclan1,
int CheckGiamDoclan2,
int CheckGiamDoclan3,
int CheckGiamDoclan4,
int CheckGiamDoclan5,
int Checkbientaplan1,
int Checkbientaplan2,
int Checkbientaplan3,
int Checkbientaplan4,
int Checkbientaplan5,
int Checkbientaplan6

          );
        public abstract IDataReader GetPublication(int ModuleId, int PublicationId);
        public abstract IDataReader GetPublications(int ModuleId);
        public abstract void UpdatePublication(int ModuleId,

int PublicationID,
int ContractTemplateID,
string TenAnPham,
string TacGia,
string DichGia,
int SoTrang,
string KhoGiay,
string Bia,
int SoLuongIn,
string QuyCach,
string NoiDung,
string SoDangKy,
int DonGia,
long TongTien,
string MaSoISBN,
string Noidungkhac,
int IsXuatBan,
int IsPrint,
string SoQuyetDinhXB,
DateTime NgayQDXB,
string NguoiKy,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
int IsDelete,
int IsLuuChieu,
string SoXuatBan,
int TempInt1,
int TempInt2,
int TempInt3,
int TempInt4,
string TempStr1,
string TempStr2,
string TempStr3,
string TempStr4,
DateTime TempDate1,
DateTime TempDate2,
                                int SoluongDatin,
int SoLuongPhatHanh,
string Filebientap,
string FIleString1,
string FIleString2,
string FIleString3,
string FIleString4,
string FIleString5,
string FIleString6,
string FIleString7,
string FIleString8,
string FIleString9,
string FIleString10,
int CheckGiamDoclan1,
int CheckGiamDoclan2,
int CheckGiamDoclan3,
int CheckGiamDoclan4,
int CheckGiamDoclan5,
int Checkbientaplan1,
int Checkbientaplan2,
int Checkbientaplan3,
int Checkbientaplan4,
int Checkbientaplan5,
int Checkbientaplan6


            );
        public abstract void DeletePublication(int ModuleId, int PublicationId);
        public abstract IDataReader GetPublicationsByCond(int ModuleId, string Cond, string Sql);

        // ContactemplateLog
        public abstract void AddContractTemplateLog(
          int ModuleId,

int ContractTemplateID,
int Type,
int Publication,
int UserCreate,
DateTime CreateDate,
string FileDinhKem,
string GhiChu,
int TrangThai,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
int IsDelete,
int tempInt1,
int tempInt2,
int tempInt3,
int tempInt4,
string tempStr1,
string tempStr2,
string tempStr3,
string tempStr4,
DateTime tempDate1,
DateTime tempDate2

          );
        public abstract IDataReader GetContractTemplateLog(int ModuleId, int ContractTemplateLogId);
        public abstract IDataReader GetContractTemplateLogs(int ModuleId);
        public abstract void UpdateContractTemplateLog(int ModuleId,

int ContractTemplateLogid,
int ContractTemplateID,
int Type,
int Publication,
int UserCreate,
DateTime CreateDate,
string FileDinhKem,
string GhiChu,
int TrangThai,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
int IsDelete,
int tempInt1,
int tempInt2,
int tempInt3,
int tempInt4,
string tempStr1,
string tempStr2,
string tempStr3,
string tempStr4,
DateTime tempDate1,
DateTime tempDate2


            );
        public abstract void DeleteContractTemplateLog(int ModuleId, int ContractTemplateLogId);
        public abstract IDataReader GetContractTemplateLogsByCond(int ModuleId, string Cond, string Sql);
               // End Kết hợp xử lý

        // DommainHosting

        public abstract void AddDommainHosting(
            int ModuleId,

string TenNhaIn,
string Diachi,
string SoDienThoai,
string Fax,
string MST,
string STK,
string NguoiPhuTrach,
string Other,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
int IsDelete,
int tempInt1,
int tempInt2,
int tempInt3,
int tempInt4,
string tempStr1,
string tempStr2,
string tempStr3,
string tempStr4,
DateTime tempDate1,
DateTime tempDate2
            );
        public abstract IDataReader GetDommainHosting(int ModuleId, int DommainHostingId);
        public abstract IDataReader GetDommainHostings(int ModuleId);
        public abstract void UpdateDommainHosting(int ModuleId,
           int DommainHostingId,
string TenNhaIn,
string Diachi,
string SoDienThoai,
string Fax,
string MST,
string STK,
string NguoiPhuTrach,
string Other,
DateTime InsertDate,
DateTime UpdateDate,
int CreateByUser,
int UpdateByUser,
int IsDelete,
int tempInt1,
int tempInt2,
int tempInt3,
int tempInt4,
string tempStr1,
string tempStr2,
string tempStr3,
string tempStr4,
DateTime tempDate1,
DateTime tempDate2
            );
        public abstract void DeleteDommainHosting(int ModuleId, int DommainHostingId);
        public abstract IDataReader GetDommainHostingsByCond(int currPage, string Cond, string Sql);
        public abstract IDataReader GetDommainHostingsByCond_count(int currPage, string Cond, string Sql);

        public abstract IDataReader GetDommainHostingsByCond_PhanTrang(int currPage, int recodperpage, int Pagesize, string Cond, string Sql);

    #endregion
    
    }
}
